<template>

  <el-dialog
    :close-on-click-modal="false"
    :visible.sync="visible"
    @close="refreshDataForm"
  >
    <h1 style="color: deepskyblue">密保修改</h1>

    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">

      <el-form-item label="密保问题1" >
        <el-select v-model="valueOne" placeholder="请选择">
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>
      </el-form-item>

      <el-form-item label="问题1答案" prop="questionOne">
        <el-input v-model="dataForm.questionOne" placeholder="问题1答案"></el-input>
      </el-form-item>
      <el-form-item label="密保问题2" >
        <el-select v-model="valueTwo" placeholder="请选择">
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>
      </el-form-item>

      <el-form-item label="问题2答案" prop="questionTwo">
        <el-input v-model="dataForm.questionTwo" placeholder="问题2答案"></el-input>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
    </span>
  </el-dialog>
</template>

<script>
  import App from "../../App";
  export default {
    name: "studentInfoupdate",
    components: {App},
    data () {
      return {
        visible: false,
        dataForm: {
          questionOne: '',
          questionTwo: '',
        },
        dataRule: {
          oldPassword: [
            { required: true, message: '不能为空', trigger: 'blur' }
          ],
          questionOne: [
            { required: true, message: '不能为空', trigger: 'blur' }
          ],
          questionTwo: [
            { required: true, message: '不能为空', trigger: 'blur' }
          ],
        },
        options: [{
          value: '选项1',
          label: '你小学学校名称'
        }, {
          value: '选项2',
          label: '你初中学校名称'
        }, {
          value: '选项3',
          label: '你高中学校名称'
        }, {
          value: '选项4',
          label: '你母亲的出生日期'
        }, {
          value: '选项5',
          label: '你父亲的出生日期'
        }],
        valueOne: '',
        valueTwo: ''
        }
      },
    methods: {
      refreshDataForm (){
        this.valueOne='',
        this.valueTwo=''
      },
      init () {
        this.visible = true
        console.log(555);
      },
      dataFormSubmit(){

  },
    }
  }
</script>
